package team.seekers.oj.homework.conventer;

import team.seekers.oj.common.converter.BaseConverter;
import team.seekers.oj.homework.dto.HomeworkProblemListDTO;

import java.io.IOException;
import java.util.List;


@org.mapstruct.MapperConfig
public interface BaseHomeworkConverter<S, T> extends BaseConverter<S, T> {

    default List<HomeworkProblemListDTO> problemsTo(byte[] problems) throws IOException, ClassNotFoundException {
        return HomeworkConvertUtils.problemsTo(problems);
    }

    default byte[] problemsFrom(List<HomeworkProblemListDTO> list) throws IOException {
        return HomeworkConvertUtils.problemsFrom(list);
    }

}